package cn.blog.dao.front;

import java.sql.Date;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.List;

import cn.blog.dao.conn.DataManager;
import cn.blog.dao.conn.RowDatas;
import cn.blog.entity.origin.Notice;

public class NotDao extends DataManager{
	private RowDatas<Notice> not;
	
	public NotDao() {
		not = new notData();
	}

	public List<Notice> getAllNot() {
		String sql = "SELECT * FROM tb_notice";
		return queryList(sql, not);
	}
	
	private class notData implements RowDatas<Notice>{

		@Override
		public Notice getRowData(ResultSet rs) throws SQLException {
			/*private int notId;//通知编号
			private String  notTitle;//通知标题
			private String  notFuTitle;//通知副标题
			private Date notTime;//通知时间
			private String notContext;//通知内容
*/			Notice not = new Notice();
			not.setNotId(rs.getInt(1));
			not.setNotTitle(rs.getString(2));
			not.setNotFuTitle(rs.getString(3));
			not.setNotTime(rs.getDate(4));
			not.setNotContext(rs.getString(5));
			return not;
		}
		
	}

}
